package com.lzq.leetcode.lanqiao;



import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Scanner;
public class s1452 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        long pass = scanner.nextLong();
        LocalDateTime localDateTime = LocalDateTime.of(1970, 1, 1, 0, 0, 0);
        LocalDateTime dateTime = localDateTime.plusSeconds(pass/1000);
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("HH:mm:ss");
        String format = dateTimeFormatter.format(dateTime);
        System.out.println( format);
    }
}
